home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch11a < prev    next >
Encoding:
Internet Message Format  |  1992-08-03  |  56.1 KB

  1. Path: uunet!zephyr.ens.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v14i001:  conquer4 - middle earth multi-player game (V4), Patch11a
  5. Message-ID: <3289@master.CNA.TEK.COM>
  6. Date: 3 Aug 92 18:34:58 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2096
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: adb@cs.bu.edu
  12. Posting-number: Volume 14, Issue 1
  13. Archive-name: conquer4/Patch11a
  14. Patch-To: conquer4: Volume 6, Issue 83-96
  15. Environment: 
  16.  
  17. [From the author...]
  18.  
  19. Enclosed is a patch for version 4 of conquer.  This patch is mostly
  20. the work of people at RIT (mcy1580@ritvax.isc.rit.edu -- spide) but does
  21. contain some adjustments by me.
  22.  
  23. The patch covers:
  24.        o  a compilation option to track usage [USERLOG]
  25.        o  a compilation option to leave space for rebellions [REVSPACE]
  26.        o  a compilation option to assign a user id to each
  27.           nation, WARNING this will change the format of the
  28.           data file, making older data files unreadable. [CHECKUSER]
  29.        o  a compilation option to control the last turn for adding. [LASTADD]
  30.  
  31. It also includes some code adjustments to better conform to ANSI C specs.
  32.  
  33. There are two files in the patch:
  34.        WARNING.p11  -- warns about the CHECKUSER compilation option.
  35.        patches11    -- contains all of the patches.
  36.  
  37. If you have the patch program, you may apply the patch by getting into
  38. the source directory and typing "patch < patches11".
  39.  
  40. Thanks once again to spide for sending me these patches... hopefully I will
  41. be able to follow up in a few months with the release of version 5.  [Like
  42. I haven't been saying that for over a year. :-)]
  43.  
  44. adam
  45. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46. #!/bin/sh
  47. # This is a shell archive (produced by shar 3.49)
  48. # To extract the files from this archive, save it to a file, remove
  49. # everything above the "!/bin/sh" line above, and type "sh file_name".
  50. #
  51. # made 07/19/1992 17:44 UTC by adb@csa
  52. # Source directory /fs/home/guest/adb/src/misc
  53. #
  54. # existing files will NOT be overwritten unless -c is specified
  55. #
  56. # This is part 1 of a multipart archive                                    
  57. # do not concatenate these parts, unpack them in order with /bin/sh        
  58. #
  59. # This shar contains:
  60. # length  mode       name
  61. # ------ ---------- ------------------------------------------
  62. #    332 -rw-r--r-- WARNING.p11
  63. # 103096 -rw-r--r-- patches11
  64. #
  65. if test -r _shar_seq_.tmp; then
  66.     echo 'Must unpack archives in sequence!'
  67.     echo Please unpack part `cat _shar_seq_.tmp` next
  68.     exit 1
  69. fi
  70. # ============= WARNING.p11 ==============
  71. if test -f 'WARNING.p11' -a X"$1" != X"-c"; then
  72.     echo 'x - skipping WARNING.p11 (File already exists)'
  73.     rm -f _shar_wnt_.tmp
  74. else
  75. > _shar_wnt_.tmp
  76. sed 's/^X//' << 'SHAR_EOF' > 'WARNING.p11' &&
  77. *** Warning:
  78. X
  79. This patch contains the "CHECKUSER" option which will make the data file
  80. incompatible with previous versions of 4.x data files.  If you wish to use
  81. this patch with 4.10 data files -=DO NOT=- compile with the CHECKUSER option
  82. enabled.
  83. X
  84. -spide
  85. X mcy1580@ultb.isc.rit.edu
  86. X mcy1580@ritvax.isc.rit.edu
  87. X
  88. -adam
  89. X adb@cs.bu.edu
  90. SHAR_EOF
  91. chmod 0644 WARNING.p11 ||
  92. echo 'restore of WARNING.p11 failed'
  93. Wc_c="`wc -c < 'WARNING.p11'`"
  94. test 332 -eq "$Wc_c" ||
  95.     echo 'WARNING.p11: original size 332, current size' "$Wc_c"
  96. rm -f _shar_wnt_.tmp
  97. fi
  98. # ============= patches11 ==============
  99. if test -f 'patches11' -a X"$1" != X"-c"; then
  100.     echo 'x - skipping patches11 (File already exists)'
  101.     rm -f _shar_wnt_.tmp
  102. else
  103. > _shar_wnt_.tmp
  104. sed 's/^X//' << 'SHAR_EOF' > 'patches11' &&
  105. diff -cr ../oldconq4/Makefile ./Makefile
  106. *** ../oldconq4/Makefile    Thu Jul  9 19:29:32 1992
  107. --- ./Makefile    Thu Jul  9 17:45:30 1992
  108. ***************
  109. *** 77,96 ****
  110. X  
  111. X  #    CURRENT is this directory.  The directory where the source
  112. X  #    and Makefile are located
  113. ! CURRENT = /usr4/acm/stud/adb/src/conquer
  114. X  
  115. X  #    DEFAULT is the directory where default nations & help files will be 
  116. X  #    stored.     It is also the default directory = where players will play 
  117. X  #    if they do not use the -d option.
  118. ! DEFAULT = /usr4/acm/stud/adb/games/conqlib
  119. X  
  120. X  #    This directory is where the executables will be stored
  121. ! EXEDIR = /usr4/acm/stud/adb/games
  122. X  
  123. X  #    Definitions used for compiling conquer
  124. X  CDEFS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DEXEDIR=\"$(EXEDIR)\"
  125. X  
  126. ! #    Options flag used for non-debugging purposes
  127. X  OPTFLG  = -O 
  128. X  
  129. X  #    Options flag used for debugging purposes
  130. --- 77,96 ----
  131. X  
  132. X  #    CURRENT is this directory.  The directory where the source
  133. X  #    and Makefile are located
  134. ! CURRENT = /usr/home/guest/adb/src/conquer
  135. X  
  136. X  #    DEFAULT is the directory where default nations & help files will be 
  137. X  #    stored.     It is also the default directory = where players will play 
  138. X  #    if they do not use the -d option.
  139. ! DEFAULT = /usr/home/guest/adb/games/conqlib
  140. X  
  141. X  #    This directory is where the executables will be stored
  142. ! EXEDIR = /usr/home/guest/adb/games
  143. X  
  144. X  #    Definitions used for compiling conquer
  145. X  CDEFS  = -DDEFAULTDIR=\"$(DEFAULT)\" -DEXEDIR=\"$(EXEDIR)\"
  146. X  
  147. ! #    Options flag used for normal compilation
  148. X  OPTFLG  = -O 
  149. X  
  150. X  #    Options flag used for debugging purposes
  151. ***************
  152. *** 214,220 ****
  153. X      touch $(PSPROG)
  154. X      touch in$(PSPROG)
  155. X  
  156. ! install:    in$(GAME) in$(ADMIN) in$(SORT) in$(PSPROG) insthelp
  157. X      @echo ""
  158. X      @echo "Installation complete"
  159. X  
  160. --- 214,220 ----
  161. X      touch $(PSPROG)
  162. X      touch in$(PSPROG)
  163. X  
  164. ! install:    in$(GAME) in$(ADMIN) in$(SORT) in$(PSPROG) insthelp instman
  165. X      @echo ""
  166. X      @echo "Installation complete"
  167. X  
  168. ***************
  169. *** 252,257 ****
  170. --- 252,261 ----
  171. X      -$(RM) $(DEFAULT)/$(HELPOUT)5
  172. X      -$(LN) $(CURRENT)/$(HELPOUT)5 $(DEFAULT)/$(HELPOUT)5
  173. X      touch insthelp
  174. + instman:
  175. +     @echo Installing man pages
  176. +     $(CP) man.pag $(EXEDIR)
  177. X  
  178. X  helpfile:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  179. X      @echo Helpfiles built
  180. Only in .: WARNING.p11
  181. diff -cr ../oldconq4/admin.c ./admin.c
  182. *** ../oldconq4/admin.c    Thu Jul  9 19:29:33 1992
  183. --- ./admin.c    Thu Jul  9 18:16:31 1992
  184. ***************
  185. *** 12,17 ****
  186. --- 12,18 ----
  187. X  
  188. X  #include "header.h"
  189. X  #include "data.h"
  190. + #include <pwd.h>
  191. X  #include <ctype.h>
  192. X  
  193. X  #include <signal.h>
  194. ***************
  195. *** 66,71 ****
  196. --- 67,73 ----
  197. X      char defaultdir[BIGLTH],cq_opts[BIGLTH];
  198. X      struct passwd *getpwnam(), *pwent;
  199. X  
  200. +     umask (MASK);
  201. X      mflag = aflag = xflag = rflag = 0;
  202. X      srand((unsigned) time((long *) 0));
  203. X      strcpy(datadir,"");
  204. ***************
  205. *** 139,145 ****
  206. X      case 'a': /* anyone with password can add player*/
  207. X          aflag++;
  208. X          break;
  209. !     case 'x': /* execute program*/
  210. X          xflag++;
  211. X          break;
  212. X      case 'r': /* read map file */
  213. --- 141,147 ----
  214. X      case 'a': /* anyone with password can add player*/
  215. X          aflag++;
  216. X          break;
  217. !     case 'x': /* execute (update) program*/
  218. X          xflag++;
  219. X          break;
  220. X      case 'r': /* read map file */
  221. ***************
  222. *** 157,163 ****
  223. X          printf("Command line format: %s [-max -dDIR -rSCENARIO]\n",argv[0]);
  224. X          printf("\t-m          make a world\n");
  225. X          printf("\t-a          add new player\n");
  226. !         printf("\t-x          execute program\n");
  227. X          printf("\t-d DIR      to use play different game\n");
  228. X          /* printf("\t-r SCENARIO read map while making a new world\n\t\t\tuses SCENARIO.ele, SCENARIO.veg, &  SCENARIO.nat\n"); */
  229. X          exit(SUCCESS);
  230. --- 159,165 ----
  231. X          printf("Command line format: %s [-max -dDIR -rSCENARIO]\n",argv[0]);
  232. X          printf("\t-m          make a world\n");
  233. X          printf("\t-a          add new player\n");
  234. !         printf("\t-x          execute (update) program\n");
  235. X          printf("\t-d DIR      to use play different game\n");
  236. X          /* printf("\t-r SCENARIO read map while making a new world\n\t\t\tuses SCENARIO.ele, SCENARIO.veg, &  SCENARIO.nat\n"); */
  237. X          exit(SUCCESS);
  238. ***************
  239. *** 270,277 ****
  240. X          printf("\n********************************************");
  241. X          printf("\n*      PREPARING TO ADD NEW PLAYERS        *");
  242. X          printf("\n********************************************\n");
  243. !         if( TURN > 5 ){
  244. !             printf("more than 5 turns have passed since game start!\n");
  245. X              printf("permission of game administrator required\n");
  246. X              if(strncmp(crypt(getpass("\nwhat is conquer super user password:"),SALT),ntn[0].passwd,PASSLTH)!=0)
  247. X              {
  248. --- 272,279 ----
  249. X          printf("\n********************************************");
  250. X          printf("\n*      PREPARING TO ADD NEW PLAYERS        *");
  251. X          printf("\n********************************************\n");
  252. !         if( TURN > LASTADD ){
  253. !             printf("more than %d turns have passed since game start!\n", LASTADD);
  254. X              printf("permission of game administrator required\n");
  255. X              if(strncmp(crypt(getpass("\nwhat is conquer super user password:"),SALT),ntn[0].passwd,PASSLTH)!=0)
  256. X              {
  257. ***************
  258. *** 290,302 ****
  259. X          /* disable interrupts */
  260. X          signal(SIGINT,SIG_IGN);
  261. X          signal(SIGQUIT,SIG_IGN);
  262. !         newlogin();
  263. X          unlink(string);
  264. X          exit(SUCCESS);
  265. X      }
  266. X  
  267. X  #ifdef OGOD
  268. !     if ((realuser != (getpwnam(LOGIN))->pw_uid ) &&
  269. X        ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  270. X        realuser != pwent->pw_uid )) {
  271. X          printf("Sorry -- you can not administrate conquer\n");
  272. --- 292,304 ----
  273. X          /* disable interrupts */
  274. X          signal(SIGINT,SIG_IGN);
  275. X          signal(SIGQUIT,SIG_IGN);
  276. !         newlogin(realuser);
  277. X          unlink(string);
  278. X          exit(SUCCESS);
  279. X      }
  280. X  
  281. X  #ifdef OGOD
  282. !     if ((realuser != (getpwnam(LOGIN)->pw_uid) ) &&
  283. X        ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  284. X        realuser != pwent->pw_uid )) {
  285. X          printf("Sorry -- you can not administrate conquer\n");
  286. ***************
  287. *** 307,313 ****
  288. X          printf("\n");
  289. X          exit(FAIL);
  290. X      }
  291. ! #endif OGOD
  292. X  
  293. X      if (xflag) {    /* update the game */
  294. X  #ifndef OGOD
  295. --- 309,315 ----
  296. X          printf("\n");
  297. X          exit(FAIL);
  298. X      }
  299. ! #endif /* OGOD */
  300. X  
  301. X      if (xflag) {    /* update the game */
  302. X  #ifndef OGOD
  303. ***************
  304. *** 322,328 ****
  305. X              printf("\n");
  306. X              exit(FAIL);
  307. X          }
  308. ! #endif OGOD
  309. X  #ifdef RUNSTOP
  310. X          /* check if any players are on */
  311. X          for (i=0;i<NTOTAL;i++) {
  312. --- 324,330 ----
  313. X              printf("\n");
  314. X              exit(FAIL);
  315. X          }
  316. ! #endif /* OGOD */
  317. X  #ifdef RUNSTOP
  318. X          /* check if any players are on */
  319. X          for (i=0;i<NTOTAL;i++) {
  320. ***************
  321. *** 333,339 ****
  322. X                  exit(FAIL);
  323. X              }
  324. X          }
  325. ! #endif RUNSTOP
  326. X          sprintf(string,"%sup",isonfile);
  327. X          if(check_lock(string,TRUE)==TRUE) {
  328. X              printf("Another update is still executing.\n");
  329. --- 335,341 ----
  330. X                  exit(FAIL);
  331. X              }
  332. X          }
  333. ! #endif /* RUNSTOP */
  334. X          sprintf(string,"%sup",isonfile);
  335. X          if(check_lock(string,TRUE)==TRUE) {
  336. X              printf("Another update is still executing.\n");
  337. ***************
  338. *** 356,362 ****
  339. X      printf("\t-a       add new player\n");
  340. X      printf("\t-d DIR   to use play different game\n");
  341. X      printf("\t-m       make a world\n");
  342. !     printf("\t-x       execute program\n");
  343. X      exit(SUCCESS);
  344. X  }
  345. X  
  346. --- 358,364 ----
  347. X      printf("\t-a       add new player\n");
  348. X      printf("\t-d DIR   to use play different game\n");
  349. X      printf("\t-m       make a world\n");
  350. !     printf("\t-x       execute (update) program\n");
  351. X      exit(SUCCESS);
  352. X  }
  353. X  
  354. ***************
  355. *** 643,649 ****
  356. X                  curntn->farm_ability += (*(tg_value+good)-'0');
  357. X              else curntn->farm_ability = MAXTGVAL;
  358. X          } else if( good <= END_SPELL ) {
  359. !             curntn->spellpts++;
  360. X          } else if( good <= END_TERROR ) {
  361. X              if(curntn->terror + (*(tg_value+good)-'0')< MAXTGVAL)
  362. X                  curntn->terror += (*(tg_value+good)-'0');
  363. --- 645,651 ----
  364. X                  curntn->farm_ability += (*(tg_value+good)-'0');
  365. X              else curntn->farm_ability = MAXTGVAL;
  366. X          } else if( good <= END_SPELL ) {
  367. !             curntn->spellpts += sptr->people/1000 +1;
  368. X          } else if( good <= END_TERROR ) {
  369. X              if(curntn->terror + (*(tg_value+good)-'0')< MAXTGVAL)
  370. X                  curntn->terror += (*(tg_value+good)-'0');
  371. diff -cr ../oldconq4/cexecute.c ./cexecute.c
  372. *** ../oldconq4/cexecute.c    Thu Jul  9 19:29:33 1992
  373. --- ./cexecute.c    Thu Jul  9 18:16:44 1992
  374. ***************
  375. *** 90,96 ****
  376. X              ntn[y].tgold += longvar;
  377. X  #ifdef DEBUG
  378. X      fprintf(stderr,"DEBUG: BRIBE BY %s of %s\n",ntn[country].name,ntn[y].name);
  379. ! #endif DEBUG
  380. X              /* x represents chance of successful bribe */
  381. X              if(npctype(curntn->active)==npctype(ntn[y].active))
  382. X                  x = 50;
  383. --- 90,96 ----
  384. X              ntn[y].tgold += longvar;
  385. X  #ifdef DEBUG
  386. X      fprintf(stderr,"DEBUG: BRIBE BY %s of %s\n",ntn[country].name,ntn[y].name);
  387. ! #endif /* DEBUG */
  388. X              /* x represents chance of successful bribe */
  389. X              if(npctype(curntn->active)==npctype(ntn[y].active))
  390. X                  x = 50;
  391. ***************
  392. *** 101,107 ****
  393. X              if( rand()%100 < x){
  394. X  #ifdef DEBUG
  395. X      fprintf(stderr,"DEBUG: BRIBE IS SUCCESS\n");
  396. ! #endif DEBUG
  397. X                  ntn[y].dstatus[country]--;
  398. X              }
  399. X              break;
  400. --- 101,107 ----
  401. X              if( rand()%100 < x){
  402. X  #ifdef DEBUG
  403. X      fprintf(stderr,"DEBUG: BRIBE IS SUCCESS\n");
  404. ! #endif /* DEBUG */
  405. X                  ntn[y].dstatus[country]--;
  406. X              }
  407. X              break;
  408. ***************
  409. *** 155,161 ****
  410. X          case NPOP:    /* set various nation attributes */
  411. X  #ifdef CONQUER
  412. X              terror_adj++;
  413. ! #endif CONQUER
  414. X              curntn->popularity = armynum;
  415. X              curntn->terror = x;
  416. X              curntn->reputation = y;
  417. --- 155,161 ----
  418. X          case NPOP:    /* set various nation attributes */
  419. X  #ifdef CONQUER
  420. X              terror_adj++;
  421. ! #endif /* CONQUER */
  422. X              curntn->popularity = armynum;
  423. X              curntn->terror = x;
  424. X              curntn->reputation = y;
  425. ***************
  426. *** 320,323 ****
  427. X      /* exit program */
  428. X      exit(FAIL);
  429. X  }
  430. ! #endif CONQUER
  431. --- 320,323 ----
  432. X      /* exit program */
  433. X      exit(FAIL);
  434. X  }
  435. ! #endif /* CONQUER */
  436. diff -cr ../oldconq4/check.c ./check.c
  437. *** ../oldconq4/check.c    Thu Jul  9 19:26:30 1992
  438. --- ./check.c    Thu Jul  9 18:16:57 1992
  439. ***************
  440. *** 187,193 ****
  441. X      fprintf(stderr,"file %s line %d\n",file,line);
  442. X      verifydata(file,line);
  443. X  }
  444. ! #endif DEBUG
  445. X  
  446. X  #include <fcntl.h>
  447. X  #ifdef FILELOCK
  448. --- 187,193 ----
  449. X      fprintf(stderr,"file %s line %d\n",file,line);
  450. X      verifydata(file,line);
  451. X  }
  452. ! #endif /* DEBUG */
  453. X  
  454. X  #include <fcntl.h>
  455. X  #ifdef FILELOCK
  456. ***************
  457. *** 199,205 ****
  458. X  #    include <sys/file.h>
  459. X  #    define do_lock(fd) flock(fd,LOCK_EX|LOCK_NB)
  460. X  #endif
  461. ! #endif FILELOCK
  462. X  
  463. X  /*
  464. X   * check_lock() -- routine to check if a file is locked.
  465. --- 199,205 ----
  466. X  #    include <sys/file.h>
  467. X  #    define do_lock(fd) flock(fd,LOCK_EX|LOCK_NB)
  468. X  #endif
  469. ! #endif /* FILELOCK */
  470. X  
  471. X  /*
  472. X   * check_lock() -- routine to check if a file is locked.
  473. ***************
  474. *** 249,254 ****
  475. X              exit(FAIL);
  476. X          }
  477. X      }
  478. ! #endif FILELOCK
  479. X      return(hold);
  480. X  }
  481. --- 249,254 ----
  482. X              exit(FAIL);
  483. X          }
  484. X      }
  485. ! #endif /* FILELOCK */
  486. X      return(hold);
  487. X  }
  488. diff -cr ../oldconq4/combat.c ./combat.c
  489. *** ../oldconq4/combat.c    Thu Jul  9 19:29:34 1992
  490. --- ./combat.c    Thu Jul  9 18:17:15 1992
  491. ***************
  492. *** 469,480 ****
  493. X              else if(retreatside==DFND) PDloss+=15;
  494. X  #ifdef DEBUG
  495. X              printf("side %d (%d %d) can't retreat...+15%% loss\n",retreatside,retreatx,retreaty);
  496. ! #endif DEBUG
  497. X              retreatside = 0;
  498. X          }
  499. X  #ifdef DEBUG
  500. X          else printf("retreat side %d to %d %d\n",retreatside,retreatx,retreaty);
  501. ! #endif DEBUG
  502. X      }
  503. X  
  504. X      if(PAloss>100) PAloss = 100;
  505. --- 469,480 ----
  506. X              else if(retreatside==DFND) PDloss+=15;
  507. X  #ifdef DEBUG
  508. X              printf("side %d (%d %d) can't retreat...+15%% loss\n",retreatside,retreatx,retreaty);
  509. ! #endif /* DEBUG */
  510. X              retreatside = 0;
  511. X          }
  512. X  #ifdef DEBUG
  513. X          else printf("retreat side %d to %d %d\n",retreatside,retreatx,retreaty);
  514. ! #endif /* DEBUG */
  515. X      }
  516. X  
  517. X      if(PAloss>100) PAloss = 100;
  518. ***************
  519. *** 795,801 ****
  520. X              retreaty=y;
  521. X  #ifdef DEBUG
  522. X              printf("armies in %d %d retreat to %d %d\n",xsctr,ysctr,x,y);
  523. ! #endif DEBUG
  524. X              return;
  525. X          }
  526. X      }
  527. --- 795,801 ----
  528. X              retreaty=y;
  529. X  #ifdef DEBUG
  530. X              printf("armies in %d %d retreat to %d %d\n",xsctr,ysctr,x,y);
  531. ! #endif /* DEBUG */
  532. X              return;
  533. X          }
  534. X      }
  535. ***************
  536. *** 996,1002 ****
  537. X      }
  538. X  #ifdef DEBUG
  539. X      printf("capture percentage: attack = %d  defend = %d\n",acptpct,dcptpct);
  540. ! #endif DEBUG
  541. X  
  542. X      /*figure combat on a one-to-one basis */
  543. X      /* use a bell curve roll */
  544. --- 996,1002 ----
  545. X      }
  546. X  #ifdef DEBUG
  547. X      printf("capture percentage: attack = %d  defend = %d\n",acptpct,dcptpct);
  548. ! #endif /* DEBUG */
  549. X  
  550. X      /*figure combat on a one-to-one basis */
  551. X      /* use a bell curve roll */
  552. ***************
  553. *** 1009,1015 ****
  554. X      PAloss = MAXLOSS * (100 - roll) / 100;
  555. X  #ifdef DEBUG
  556. X      printf("Pdloss = %d  PAloss = %d\n",PDloss,PAloss);
  557. ! #endif DEBUG
  558. X  
  559. X      /* adjust based on the odds */
  560. X      if( odds == 1 ) {
  561. --- 1009,1015 ----
  562. X      PAloss = MAXLOSS * (100 - roll) / 100;
  563. X  #ifdef DEBUG
  564. X      printf("Pdloss = %d  PAloss = %d\n",PDloss,PAloss);
  565. ! #endif /* DEBUG */
  566. X  
  567. X      /* adjust based on the odds */
  568. X      if( odds == 1 ) {
  569. ***************
  570. *** 1319,1325 ****
  571. X  #ifdef DEBUG
  572. X      printf("capture: hdcnt==%d typ==%d spsz==%d to==%d\n",holdcount,
  573. X            type,shipsize,to);
  574. ! #endif DEBUG
  575. X      for (i=0;holdcount && i<count;i++) {
  576. X          if (owner[i]!=(-1) && side[i]==to) {
  577. X              curntn= &ntn[owner[i]];
  578. --- 1319,1325 ----
  579. X  #ifdef DEBUG
  580. X      printf("capture: hdcnt==%d typ==%d spsz==%d to==%d\n",holdcount,
  581. X            type,shipsize,to);
  582. ! #endif /* DEBUG */
  583. X      for (i=0;holdcount && i<count;i++) {
  584. X          if (owner[i]!=(-1) && side[i]==to) {
  585. X              curntn= &ntn[owner[i]];
  586. ***************
  587. *** 1332,1338 ****
  588. X      }
  589. X  #ifdef DEBUG
  590. X      printf("capture 2: holdcount==%d i==%d\n",holdcount,i);
  591. ! #endif DEBUG
  592. X      if (i==count) {
  593. X          curntn = saventn;
  594. X          return;
  595. --- 1332,1338 ----
  596. X      }
  597. X  #ifdef DEBUG
  598. X      printf("capture 2: holdcount==%d i==%d\n",holdcount,i);
  599. ! #endif /* DEBUG */
  600. X      if (i==count) {
  601. X          curntn = saventn;
  602. X          return;
  603. ***************
  604. *** 1339,1346 ****
  605. X      }
  606. X      nvynum = unit[i];
  607. X  #ifdef DEBUG
  608. !     printf("Should have succesful capture of %d\n",type);
  609. ! #endif DEBUG
  610. X      switch(type) {
  611. X      case QWAR:
  612. X          (void) NADD_WAR(1);
  613. --- 1339,1346 ----
  614. X      }
  615. X      nvynum = unit[i];
  616. X  #ifdef DEBUG
  617. !     printf("Should have successful capture of %d\n",type);
  618. ! #endif /* DEBUG */
  619. X      switch(type) {
  620. X      case QWAR:
  621. X          (void) NADD_WAR(1);
  622. diff -cr ../oldconq4/commands.c ./commands.c
  623. *** ../oldconq4/commands.c    Thu Jul  9 19:29:35 1992
  624. --- ./commands.c    Thu Jul  9 18:17:31 1992
  625. ***************
  626. *** 1145,1151 ****
  627. X  #ifdef SYSMAIL
  628. X      /* increase size to ensure mail check works */
  629. X      conq_mail_size++;
  630. ! #endif SYSMAIL
  631. X  }
  632. X  
  633. X  void
  634. --- 1145,1151 ----
  635. X  #ifdef SYSMAIL
  636. X      /* increase size to ensure mail check works */
  637. X      conq_mail_size++;
  638. ! #endif /* SYSMAIL */
  639. X  }
  640. X  
  641. X  void
  642. diff -cr ../oldconq4/data.c ./data.c
  643. *** ../oldconq4/data.c    Thu Jul  9 19:26:28 1992
  644. --- ./data.c    Thu Jul  9 18:17:49 1992
  645. ***************
  646. *** 47,53 ****
  647. X  char *soldname[]= { "?","MARCH","SCOUT","GARRISON","TRADED","MILITIA",
  648. X      "FLYING","DEFEND","MAG_DEF","ATTACK","MAG_ATT","GENERAL","SORTIE",
  649. X      "SIEGE","BESIEGED","ON_BOARD","RULE"};
  650. ! #endif CONQUER
  651. X  
  652. X  char *directions[]= { "here", "north", "northeast", "east", "southeast",
  653. X      "south", "southwest", "west", "northwest"};
  654. --- 47,53 ----
  655. X  char *soldname[]= { "?","MARCH","SCOUT","GARRISON","TRADED","MILITIA",
  656. X      "FLYING","DEFEND","MAG_DEF","ATTACK","MAG_ATT","GENERAL","SORTIE",
  657. X      "SIEGE","BESIEGED","ON_BOARD","RULE"};
  658. ! #endif /* CONQUER */
  659. X  
  660. X  char *directions[]= { "here", "north", "northeast", "east", "southeast",
  661. X      "south", "southwest", "west", "northwest"};
  662. ***************
  663. *** 82,88 ****
  664. X  "Hero", "Cent", "gt", "Shro", "Mumm",
  665. X  "Elem", "mino", "daem", "Bal", "Drgn"
  666. X  };
  667. ! #endif CONQUER
  668. X  int unitminsth[]=        /* min strength of a unit */
  669. X  {
  670. X  1, 1, 1, 1, 1, 1, 1,
  671. --- 82,88 ----
  672. X  "Hero", "Cent", "gt", "Shro", "Mumm",
  673. X  "Elem", "mino", "daem", "Bal", "Drgn"
  674. X  };
  675. ! #endif /* CONQUER */
  676. X  int unitminsth[]=        /* min strength of a unit */
  677. X  {
  678. X  1, 1, 1, 1, 1, 1, 1,
  679. ***************
  680. *** 187,199 ****
  681. X  #ifdef ADMIN
  682. X  char    scenario[NAMELTH+1];
  683. X  char    *npcsfile = "nations";
  684. ! #endif ADMIN
  685. X  char    *helpfile = "help";
  686. X  char    *newsfile = "news";
  687. X  char    *isonfile = "lock";
  688. X  #ifdef TRADE
  689. X  char    *tradefile = "commerce";
  690. ! #endif TRADE
  691. X  
  692. X  char    *seasonstr[] = { "Winter", "Spring", "Summer", "Fall" };
  693. X  
  694. --- 187,199 ----
  695. X  #ifdef ADMIN
  696. X  char    scenario[NAMELTH+1];
  697. X  char    *npcsfile = "nations";
  698. ! #endif /* ADMIN */
  699. X  char    *helpfile = "help";
  700. X  char    *newsfile = "news";
  701. X  char    *isonfile = "lock";
  702. X  #ifdef TRADE
  703. X  char    *tradefile = "commerce";
  704. ! #endif /* TRADE */
  705. X  
  706. X  char    *seasonstr[] = { "Winter", "Spring", "Summer", "Fall" };
  707. X  
  708. ***************
  709. *** 253,262 ****
  710. X  #ifdef SYSMAIL
  711. X  char    sysmail[FILELTH];
  712. X  int    sys_mail_status;
  713. ! #endif SYSMAIL
  714. X  char conqmail[FILELTH];
  715. X  int    conq_mail_status;
  716. ! #endif CONQUER
  717. X  
  718. X  /* trade good value - zeroes in this comment line mark increments of ten*/
  719. X  /*              0         0         0         0         0         0 */
  720. --- 253,262 ----
  721. X  #ifdef SYSMAIL
  722. X  char    sysmail[FILELTH];
  723. X  int    sys_mail_status;
  724. ! #endif /* SYSMAIL */
  725. X  char conqmail[FILELTH];
  726. X  int    conq_mail_status;
  727. ! #endif /* CONQUER */
  728. X  
  729. X  /* trade good value - zeroes in this comment line mark increments of ten*/
  730. X  /*              0         0         0         0         0         0 */
  731. diff -cr ../oldconq4/data.h ./data.h
  732. *** ../oldconq4/data.h    Thu Jul  9 19:26:25 1992
  733. --- ./data.h    Thu Jul  9 17:52:44 1992
  734. ***************
  735. *** 375,380 ****
  736. --- 375,383 ----
  737. X      char    race;        /* national race (integer--see header.h)*/
  738. X      char    location;    /* location variable (gfr)    */
  739. X      char    mark;        /* unique mark for nation    */
  740. + #ifdef CHECKUSER
  741. +     short int uid;        /* for uid checking (CHECKUSER) */
  742. + #endif /* CHECKUSER */
  743. X      unsigned char    capx;    /* Capitol x coordinate        */
  744. X      unsigned char    capy;    /* Capitol y coordinate        */
  745. X      unsigned char    active;    /* nation type and strategy    */
  746. diff -cr ../oldconq4/extcmds.c ./extcmds.c
  747. *** ../oldconq4/extcmds.c    Thu Jul  9 19:29:33 1992
  748. --- ./extcmds.c    Thu Jul  9 18:18:05 1992
  749. ***************
  750. *** 92,98 ****
  751. X      switch(astat) {
  752. X  #ifdef TRADE
  753. X      case TRADED:
  754. ! #endif TRADE
  755. X      case FLIGHT:
  756. X      case MAGATT:
  757. X      case MAGDEF:
  758. --- 92,98 ----
  759. X      switch(astat) {
  760. X  #ifdef TRADE
  761. X      case TRADED:
  762. ! #endif /* TRADE */
  763. X      case FLIGHT:
  764. X      case MAGATT:
  765. X      case MAGDEF:
  766. ***************
  767. *** 267,273 ****
  768. X      if(men<25 || armynum < 0 || armynum >= MAXARM || P_ASOLD < men+25 || P_ASTAT==ONBOARD || P_ASTAT==TRADED) {
  769. X  #else
  770. X      if(men<25 || armynum < 0 || armynum >= MAXARM || P_ASOLD < men+25 || P_ASTAT==ONBOARD) {
  771. ! #endif TRADE
  772. X          errormsg("Selected army too small or illegal");
  773. X          return;
  774. X      }
  775. --- 267,273 ----
  776. X      if(men<25 || armynum < 0 || armynum >= MAXARM || P_ASOLD < men+25 || P_ASTAT==ONBOARD || P_ASTAT==TRADED) {
  777. X  #else
  778. X      if(men<25 || armynum < 0 || armynum >= MAXARM || P_ASOLD < men+25 || P_ASTAT==ONBOARD) {
  779. ! #endif /* TRADE */
  780. X          errormsg("Selected army too small or illegal");
  781. X          return;
  782. X      }
  783. diff -cr ../oldconq4/forms.c ./forms.c
  784. *** ../oldconq4/forms.c    Thu Jul  9 19:29:34 1992
  785. --- ./forms.c    Thu Jul  9 18:18:14 1992
  786. ***************
  787. *** 391,397 ****
  788. X      short isgod=FALSE;
  789. X  #ifdef OGOD
  790. X      FILE *ftmp;
  791. ! #endif OGOD
  792. X      char filename[FILELTH];
  793. X  
  794. X      if(country==0) {
  795. --- 391,397 ----
  796. X      short isgod=FALSE;
  797. X  #ifdef OGOD
  798. X      FILE *ftmp;
  799. ! #endif /* OGOD */
  800. X      char filename[FILELTH];
  801. X  
  802. X      if(country==0) {
  803. ***************
  804. *** 491,497 ****
  805. X      if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-33,"HIT 8 TO DESTROY, 9 TO CHANGE COMMODITY OR '0' TO CHANGE DEMI-GOD");
  806. X  #else OGOD
  807. X      if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION, OR '0' TO CHANGE DEMI-GOD");
  808. ! #endif OGOD
  809. X      else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
  810. X      standend();
  811. X      refresh();
  812. --- 491,497 ----
  813. X      if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-33,"HIT 8 TO DESTROY, 9 TO CHANGE COMMODITY OR '0' TO CHANGE DEMI-GOD");
  814. X  #else OGOD
  815. X      if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION, OR '0' TO CHANGE DEMI-GOD");
  816. ! #endif /* OGOD */
  817. X      else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
  818. X      standend();
  819. X      refresh();
  820. ***************
  821. *** 773,779 ****
  822. X              fclose(ftmp);
  823. X          }
  824. X          break;
  825. ! #endif OGOD
  826. X      case '0':
  827. X          if(isgod==TRUE) {
  828. X              mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
  829. --- 773,779 ----
  830. X              fclose(ftmp);
  831. X          }
  832. X          break;
  833. ! #endif /* OGOD */
  834. X      case '0':
  835. X          if(isgod==TRUE) {
  836. X              mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
  837. Only in .: getopt.c
  838. diff -cr ../oldconq4/header.h ./header.h
  839. *** ../oldconq4/header.h    Thu Jul  9 19:29:33 1992
  840. --- ./header.h    Thu Jul  9 17:52:04 1992
  841. ***************
  842. *** 1,8 ****
  843. X  /* conquer : Copyright (c) 1988, 1989 by Ed Barlow.    
  844. X     MODIFICATION OF THIS FILE IMPLIES THAT THE MODIFIER WILL ACCEPT
  845. X      A LIMITED USE COPYRIGHT AS FOLLOWS:
  846. X  
  847. X      1) This software is copyrighted and protected by law. The
  848. X          sole owner of this software, which hereafter is known as
  849. X          "conquer" is Edward M. Barlow, who hereby grants you a
  850. --- 1,8 ----
  851. X  /* conquer : Copyright (c) 1988, 1989 by Ed Barlow.    
  852. X     MODIFICATION OF THIS FILE IMPLIES THAT THE MODIFIER WILL ACCEPT
  853. X      A LIMITED USE COPYRIGHT AS FOLLOWS:
  854. X  
  855. X      1) This software is copyrighted and protected by law. The
  856. X          sole owner of this software, which hereafter is known as
  857. X          "conquer" is Edward M. Barlow, who hereby grants you a
  858. ***************
  859. *** 44,69 ****
  860. X  */
  861. X  
  862. X  /* --- MODIFICATION IS REQUIRED OF THE FOLLOWING DEFINE STATEMENTS ---    */
  863. ! #define OWNER    "Ed Barlow"    /* administrators name            */
  864. ! #define LOGIN    "smile"        /* administrators login id. IMPORTANT!    */
  865. X                          /* only this UID may update.        */
  866. ! #define SYSV        /* uncomment this line on a UNIX SYSV machine    */
  867. ! /* #define BSD        /* uncomment this line on a BSD machine        */
  868. X  /* #define HPUX        /* uncomment for HP-UNIX            */
  869. ! /*#define XENIX               /* this plus SYSV for XENIX machines, untested  */
  870. ! /* #define SYSMAIL    /* if your system supports mail            */
  871. X              /* conquer will notify you about system mail    */
  872. X  
  873. ! /* -------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-----------*/
  874. X  #define SPOOLDIR "/usr/spool/mail"    /* location of mail spool    */
  875. ! /* #define FILELOCK    /* if your system supports BSD flock()        */
  876. X              /* other file locking is not well implemented    */
  877. ! /*#define LOCKF               /* in addition to FILELOCK if you have lockf    */
  878. ! #define TIMELOG    /* if your system has the date command        */
  879. X  
  880. X  #define NTOTAL 25    /* max # of nations ( player + npc + monster )    */
  881. X  #define MAXPTS    65    /* points for players to buy stuff with at start*/
  882. ! #define MAXARM    40    /* maximum number of armies per nation        */
  883. X  #define MAXNAVY    10    /* maximum number of fleets per nation        */
  884. X  #define PDEPLETE 30    /* % of armies/sectors depleted without Capitol    */
  885. X  #define PFINDSCOUT 50    /* percentage chance for capturing scouts    */
  886. --- 44,70 ----
  887. X  */
  888. X  
  889. X  /* --- MODIFICATION IS REQUIRED OF THE FOLLOWING DEFINE STATEMENTS ---    */
  890. ! #define OWNER    "Adam Bryant"    /* administrators name            */
  891. ! #define LOGIN    "adb"        /* administrators login id. IMPORTANT!    */
  892. X                          /* only this UID may update.        */
  893. ! /* #define SYSV        /* uncomment this line on a UNIX SYSV machine    */
  894. ! #define BSD        /* uncomment this line on a BSD machine        */
  895. X  /* #define HPUX        /* uncomment for HP-UNIX            */
  896. ! /*#define XENIX        /* this plus SYSV for XENIX machines, untested  */
  897. ! #define SYSMAIL        /* if your system supports mail            */
  898. X              /* conquer will notify you about system mail    */
  899. X  
  900. ! /* ------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING----------*/
  901. X  #define SPOOLDIR "/usr/spool/mail"    /* location of mail spool    */
  902. ! #define FILELOCK    /* if your system supports BSD flock()        */
  903. X              /* other file locking is not well implemented    */
  904. ! /*#define LOCKF        /* in addition to FILELOCK if you have lockf    */
  905. !             /* this is needed on NFS remote file systems    */
  906. ! #define TIMELOG        /* if your system has the date command        */
  907. X  
  908. X  #define NTOTAL 25    /* max # of nations ( player + npc + monster )    */
  909. X  #define MAXPTS    65    /* points for players to buy stuff with at start*/
  910. ! #define MAXARM    50    /* maximum number of armies per nation        */
  911. X  #define MAXNAVY    10    /* maximum number of fleets per nation        */
  912. X  #define PDEPLETE 30    /* % of armies/sectors depleted without Capitol    */
  913. X  #define PFINDSCOUT 50    /* percentage chance for capturing scouts    */
  914. ***************
  915. *** 79,85 ****
  916. X  #define REMAKE        /* may make a world even if datafile exists.    */
  917. X              /* this allows demi-gods the ability to remake  */
  918. X              /* their world.                                 */
  919. ! /* #define NOSCORE    /* only show full scores to god while in game    */
  920. X  #define DERVDESG    /* allow DERVISH to redesignate in DESERT/ICE    */
  921. X  #define MONSTER    45    /* defined if pirates/savages/nomads/lzard exist.
  922. X                 represents # of sectors of land that need to be
  923. --- 80,91 ----
  924. X  #define REMAKE        /* may make a world even if datafile exists.    */
  925. X              /* this allows demi-gods the ability to remake  */
  926. X              /* their world.                                 */
  927. ! #define NOSCORE        /* only show full scores to god while in game    */
  928. ! /* #define CHECKUSER */    /* only allow owner of nation to play it        */
  929. ! #define REVSPACE 5    /* allow for this many revolts in nation list   */
  930. ! #define LASTADD 5    /* last turn players may w/out password         */
  931. ! #define USERLOG        /* log users who play a nation                  */
  932. ! #define MASK 037    /* data file protection mask (umask)            */
  933. X  #define DERVDESG    /* allow DERVISH to redesignate in DESERT/ICE    */
  934. X  #define MONSTER    45    /* defined if pirates/savages/nomads/lzard exist.
  935. X                 represents # of sectors of land that need to be
  936. diff -cr ../oldconq4/io.c ./io.c
  937. *** ../oldconq4/io.c    Thu Jul  9 19:22:33 1992
  938. --- ./io.c    Thu Jul  9 18:18:26 1992
  939. ***************
  940. *** 209,215 ****
  941. X          putc('\n',stdout);
  942. X      }
  943. X  }
  944. ! #endif CONQUER
  945. X  
  946. X  /************************************************************************/
  947. X  /*    WRITEDATA() - write data to datafile                 */
  948. --- 209,215 ----
  949. X          putc('\n',stdout);
  950. X      }
  951. X  }
  952. ! #endif /* CONQUER */
  953. X  
  954. X  /************************************************************************/
  955. X  /*    WRITEDATA() - write data to datafile                 */
  956. ***************
  957. *** 223,229 ****
  958. X  
  959. X      printf("\ndoing write of data\n");
  960. X      if((fd = creat(datafile,0666))==-1) {
  961. !         printf("cant open data.  check permissions\n");
  962. X          abrt();
  963. X      }
  964. X  
  965. --- 223,229 ----
  966. X  
  967. X      printf("\ndoing write of data\n");
  968. X      if((fd = creat(datafile,0666))==-1) {
  969. !         printf("cannot open data.  check permissions\n");
  970. X          abrt();
  971. X      }
  972. X  
  973. ***************
  974. *** 277,283 ****
  975. X      }
  976. X  #ifdef DEBUG
  977. X      fprintf(stderr,"reading %d bytes of world data\n",sizeof(struct s_world));
  978. ! #endif DEBUG
  979. X  
  980. X      getspace();
  981. X  
  982. --- 277,283 ----
  983. X      }
  984. X  #ifdef DEBUG
  985. X      fprintf(stderr,"reading %d bytes of world data\n",sizeof(struct s_world));
  986. ! #endif /* DEBUG */
  987. X  
  988. X      getspace();
  989. X  
  990. ***************
  991. *** 291,297 ****
  992. X      }
  993. X  #ifdef DEBUG
  994. X      fprintf(stderr,"reading %d bytes of sector data\n",n_read);
  995. ! #endif DEBUG
  996. X      if((n_read=read(fd,ntn,NTOTAL*sizeof(struct s_nation))) == -1)
  997. X          printf("error reading s_nation data (ntn)\n");
  998. X      else if(n_read!= NTOTAL*sizeof(struct s_nation)) {
  999. --- 291,297 ----
  1000. X      }
  1001. X  #ifdef DEBUG
  1002. X      fprintf(stderr,"reading %d bytes of sector data\n",n_read);
  1003. ! #endif /* DEBUG */
  1004. X      if((n_read=read(fd,ntn,NTOTAL*sizeof(struct s_nation))) == -1)
  1005. X          printf("error reading s_nation data (ntn)\n");
  1006. X      else if(n_read!= NTOTAL*sizeof(struct s_nation)) {
  1007. ***************
  1008. *** 301,307 ****
  1009. X      }
  1010. X  #ifdef DEBUG
  1011. X      fprintf(stderr,"reading %d bytes of nation data\n",n_read);
  1012. ! #endif DEBUG
  1013. X      close(fd);
  1014. X  } /* readdata() */
  1015. X  
  1016. --- 301,307 ----
  1017. X      }
  1018. X  #ifdef DEBUG
  1019. X      fprintf(stderr,"reading %d bytes of nation data\n",n_read);
  1020. ! #endif /* DEBUG */
  1021. X      close(fd);
  1022. X  } /* readdata() */
  1023. X  
  1024. ***************
  1025. *** 535,541 ****
  1026. X          }
  1027. X      }
  1028. X  }
  1029. ! #endif CONQUER
  1030. X  
  1031. X  /************************************************************************/
  1032. X  /*    FLEE() - civilains in x,y flee from somebody            */
  1033. --- 535,541 ----
  1034. X          }
  1035. X      }
  1036. X  }
  1037. ! #endif /* CONQUER */
  1038. X  
  1039. X  /************************************************************************/
  1040. X  /*    FLEE() - civilains in x,y flee from somebody            */
  1041. ***************
  1042. *** 576,582 ****
  1043. X              mvaddstr(LINES-2,20,"CIVILIANS ABANDON SECTOR");
  1044. X          }
  1045. X      }
  1046. ! #endif CONQUER
  1047. X      for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
  1048. X          if(ONMAP(i,j)
  1049. X          &&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
  1050. --- 576,582 ----
  1051. X              mvaddstr(LINES-2,20,"CIVILIANS ABANDON SECTOR");
  1052. X          }
  1053. X      }
  1054. ! #endif /* CONQUER */
  1055. X      for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++)
  1056. X          if(ONMAP(i,j)
  1057. X          &&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
  1058. ***************
  1059. *** 594,600 ****
  1060. X          if(count>0) {
  1061. X  #ifdef CONQUER
  1062. X          if(isupd==0) mvaddstr(LINES-2,20,"PEOPLE FLEE SECTOR AND HALF DIE");
  1063. ! #endif CONQUER
  1064. X          for(i=x-4;i<=x+4;i++) for(j=y-4;j<=y+4;j++)
  1065. X              if(ONMAP(i,j)
  1066. X              &&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
  1067. --- 594,600 ----
  1068. X          if(count>0) {
  1069. X  #ifdef CONQUER
  1070. X          if(isupd==0) mvaddstr(LINES-2,20,"PEOPLE FLEE SECTOR AND HALF DIE");
  1071. ! #endif /* CONQUER */
  1072. X          for(i=x-4;i<=x+4;i++) for(j=y-4;j<=y+4;j++)
  1073. X              if(ONMAP(i,j)
  1074. X              &&(ntn[sct[i][j].owner].race==ntn[sct[x][y].owner].race)) {
  1075. ***************
  1076. *** 604,610 ****
  1077. X          }
  1078. X  #ifdef CONQUER
  1079. X          else if(isupd==0) mvaddstr(LINES-2,20,"PEOPLE IN SECTOR DIE");
  1080. ! #endif CONQUER
  1081. X      }
  1082. X  
  1083. X      sct[x][y].people = slaves;
  1084. --- 604,610 ----
  1085. X          }
  1086. X  #ifdef CONQUER
  1087. X          else if(isupd==0) mvaddstr(LINES-2,20,"PEOPLE IN SECTOR DIE");
  1088. ! #endif /* CONQUER */
  1089. X      }
  1090. X  
  1091. X      sct[x][y].people = slaves;
  1092. ***************
  1093. *** 664,670 ****
  1094. X  
  1095. X      return(TRUE);
  1096. X  }
  1097. ! #endif ADMIN
  1098. X  
  1099. X  /*********************************************************************/
  1100. X  /* M2ALLOC() - two dimensional array allocator (because C is stupid) */
  1101. --- 664,670 ----
  1102. X  
  1103. X      return(TRUE);
  1104. X  }
  1105. ! #endif /* ADMIN */
  1106. X  
  1107. X  /*********************************************************************/
  1108. X  /* M2ALLOC() - two dimensional array allocator (because C is stupid) */
  1109. ***************
  1110. *** 681,687 ****
  1111. X          malloc( (unsigned) (nrows*(sizeof(char *)+entrysize)));
  1112. X  
  1113. X      if( baseaddr == (char **) NULL ) {
  1114. !         printf("OOPS - cant allocate %d by %d blocks of %d bytes\n",nrows,ncols,entrysize);
  1115. X          abrt();
  1116. X      }
  1117. X      if(nrows>0){
  1118. --- 681,687 ----
  1119. X          malloc( (unsigned) (nrows*(sizeof(char *)+entrysize)));
  1120. X  
  1121. X      if( baseaddr == (char **) NULL ) {
  1122. !         printf("OOPS - cannot allocate %d by %d blocks of %d bytes\n",nrows,ncols,entrysize);
  1123. X          abrt();
  1124. X      }
  1125. X      if(nrows>0){
  1126. diff -cr ../oldconq4/magic.c ./magic.c
  1127. *** ../oldconq4/magic.c    Thu Jul  9 19:26:28 1992
  1128. --- ./magic.c    Thu Jul  9 18:18:45 1992
  1129. ***************
  1130. *** 246,252 ****
  1131. X              refresh();
  1132. X              if (getch()=='y') god_magk();
  1133. X          } else
  1134. ! #endif OGOD
  1135. X          if(price <= curntn->jewels){
  1136. X  
  1137. X          mvaddstr(county++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER? [yn]");
  1138. --- 246,252 ----
  1139. X              refresh();
  1140. X              if (getch()=='y') god_magk();
  1141. X          } else
  1142. ! #endif /* OGOD */
  1143. X          if(price <= curntn->jewels){
  1144. X  
  1145. X          mvaddstr(county++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER? [yn]");
  1146. ***************
  1147. *** 285,295 ****
  1148. X  #ifdef ORCTAKE
  1149. X          if((curntn->race==ORC)&&(curntn->jewels>=ORCTAKE)&&(curntn->spellpts>=TAKEPOINTS))
  1150. X              done |= orctake(&county);
  1151. ! #endif ORCTAKE
  1152. X      }
  1153. X      if(isgod==TRUE) reset_god();
  1154. X  }
  1155. ! #endif CONQUER
  1156. X  #ifdef ORCTAKE
  1157. X  /*do magic for both npcs and pcs in update*/
  1158. X  /*if target is 0 then it is update and target will be picked randomly*/
  1159. --- 285,295 ----
  1160. X  #ifdef ORCTAKE
  1161. X          if((curntn->race==ORC)&&(curntn->jewels>=ORCTAKE)&&(curntn->spellpts>=TAKEPOINTS))
  1162. X              done |= orctake(&county);
  1163. ! #endif /* ORCTAKE */
  1164. X      }
  1165. X      if(isgod==TRUE) reset_god();
  1166. X  }
  1167. ! #endif /* CONQUER */
  1168. X  #ifdef ORCTAKE
  1169. X  /*do magic for both npcs and pcs in update*/
  1170. X  /*if target is 0 then it is update and target will be picked randomly*/
  1171. ***************
  1172. *** 341,347 ****
  1173. X      country=save;
  1174. X      return(0);
  1175. X  }
  1176. ! #endif ORCTAKE
  1177. X  
  1178. X  /*execute new magic*/
  1179. X  void
  1180. --- 341,347 ----
  1181. X      country=save;
  1182. X      return(0);
  1183. X  }
  1184. ! #endif /* ORCTAKE */
  1185. X  
  1186. X  /*execute new magic*/
  1187. X  void
  1188. ***************
  1189. *** 392,398 ****
  1190. X                  &&((rand()%2)==0)
  1191. X  #else
  1192. X                  &&(tofood( &sct[x][y],0)<6)
  1193. ! #endif DERVDESG
  1194. X                  &&((x!=curntn->capx)
  1195. X                      ||(y!=curntn->capy))){
  1196. X                      sct[x][y].vegetation=DESERT;
  1197. --- 392,398 ----
  1198. X                  &&((rand()%2)==0)
  1199. X  #else
  1200. X                  &&(tofood( &sct[x][y],0)<6)
  1201. ! #endif /* DERVDESG */
  1202. X                  &&((x!=curntn->capx)
  1203. X                      ||(y!=curntn->capy))){
  1204. X                      sct[x][y].vegetation=DESERT;
  1205. ***************
  1206. *** 401,407 ****
  1207. X              }
  1208. X          }
  1209. X          fprintf(fnews,"1.\tnation %s gets destroyer power: land turns to desert\n",curntn->name);
  1210. ! #endif ADMIN
  1211. X          updmove(curntn->race,country);
  1212. X          return;
  1213. X      }
  1214. --- 401,407 ----
  1215. X              }
  1216. X          }
  1217. X          fprintf(fnews,"1.\tnation %s gets destroyer power: land turns to desert\n",curntn->name);
  1218. ! #endif /* ADMIN */
  1219. X          updmove(curntn->race,country);
  1220. X          return;
  1221. X      }
  1222. ***************
  1223. *** 636,643 ****
  1224. X      }
  1225. X      return(done);
  1226. X  }
  1227. ! #endif ORCTAKE
  1228. ! #endif CONQUER
  1229. X  #ifdef CONQUER
  1230. X  
  1231. X  /**********************************************************************/
  1232. --- 636,643 ----
  1233. X      }
  1234. X      return(done);
  1235. X  }
  1236. ! #endif /* ORCTAKE */
  1237. ! #endif /* CONQUER */
  1238. X  #ifdef CONQUER
  1239. X  
  1240. X  /**********************************************************************/
  1241. ***************
  1242. *** 715,721 ****
  1243. X      }
  1244. X      return(valid);
  1245. X  }
  1246. ! #endif CONQUER
  1247. X  
  1248. X  /*remove properties of magic power; must first remove power */
  1249. X  void
  1250. --- 715,721 ----
  1251. X      }
  1252. X      return(valid);
  1253. X  }
  1254. ! #endif /* CONQUER */
  1255. X  
  1256. X  /*remove properties of magic power; must first remove power */
  1257. X  void
  1258. ***************
  1259. *** 905,911 ****
  1260. X          if (getch()=='y') done=FALSE;
  1261. X      }
  1262. X  }
  1263. ! #endif OGOD
  1264. X  
  1265. X  #define NUMSPELLS 4
  1266. X  char *spellstr[NUMSPELLS]={"(S)ummon","(F)light","(A)ttack Enhancement",
  1267. --- 905,911 ----
  1268. X          if (getch()=='y') done=FALSE;
  1269. X      }
  1270. X  }
  1271. ! #endif /* OGOD */
  1272. X  
  1273. X  #define NUMSPELLS 4
  1274. X  char *spellstr[NUMSPELLS]={"(S)ummon","(F)light","(A)ttack Enhancement",
  1275. ***************
  1276. *** 993,996 ****
  1277. X      else errormsg("You have no spell points for spell casting");
  1278. X      makebottom();
  1279. X  }
  1280. ! #endif CONQUER
  1281. --- 993,996 ----
  1282. X      else errormsg("You have no spell points for spell casting");
  1283. X      makebottom();
  1284. X  }
  1285. ! #endif /* CONQUER */
  1286. diff -cr ../oldconq4/main.c ./main.c
  1287. *** ../oldconq4/main.c    Thu Jul  9 19:29:35 1992
  1288. --- ./main.c    Thu Jul  9 18:18:56 1992
  1289. ***************
  1290. *** 58,63 ****
  1291. --- 58,71 ----
  1292. X  int    argc;
  1293. X  char    **argv;
  1294. X  {
  1295. + #ifdef  USERLOG
  1296. +     FILE *userlog;
  1297. + #endif
  1298. + #ifdef  CHECKUSER
  1299. +     int checkuser_mod = FALSE;
  1300. +     int checkuser_uid = 0;
  1301. +     int checkuser_list = FALSE;
  1302. + #endif
  1303. X      int geteuid(), getuid(), setuid();
  1304. X      register int i,j;
  1305. X      char name[NAMELTH+1],filename[FILELTH];
  1306. ***************
  1307. *** 71,77 ****
  1308. X      extern char *optarg, conqmail[];
  1309. X  #ifdef SYSMAIL
  1310. X      extern char sysmail[];
  1311. ! #endif SYSMAIL
  1312. X      int sflag=FALSE,pflag=FALSE,l,in_ch,old_ch=' ';
  1313. X  
  1314. X      char defaultdir[BIGLTH],tmppass[PASSLTH+1];
  1315. --- 79,85 ----
  1316. X      extern char *optarg, conqmail[];
  1317. X  #ifdef SYSMAIL
  1318. X      extern char sysmail[];
  1319. ! #endif /* SYSMAIL */
  1320. X      int sflag=FALSE,pflag=FALSE,l,in_ch,old_ch=' ';
  1321. X  
  1322. X      char defaultdir[BIGLTH],tmppass[PASSLTH+1];
  1323. ***************
  1324. *** 174,180 ****
  1325. --- 182,192 ----
  1326. X      }
  1327. X  
  1328. X      /* process the command line arguments */
  1329. + #ifdef CHECKUSER
  1330. +     while((i=getopt(argc,argv,"Ghpln:u:d:s"))!=EOF) switch(i){
  1331. + #else
  1332. X      while((i=getopt(argc,argv,"Ghpn:d:s"))!=EOF) switch(i){
  1333. + #endif
  1334. X      /* process the command line arguments */
  1335. X      case 'h': /* execute help program*/
  1336. X          initscr();
  1337. ***************
  1338. *** 203,213 ****
  1339. --- 215,242 ----
  1340. X      case 'n':
  1341. X          strcpy(name, optarg);
  1342. X          break;
  1343. + #ifdef CHECKUSER
  1344. +     case 'l':
  1345. +         checkuser_list = TRUE;
  1346. +         break;
  1347. +     case 'u':
  1348. +         checkuser_mod = TRUE;    /* check for god later */
  1349. +         checkuser_uid = owneruid;
  1350. +         if (strlen (optarg) > 0)
  1351. +            if (getpwnam(optarg))
  1352. +               checkuser_uid = getpwnam(optarg)->pw_uid;
  1353. + #endif
  1354. X      case 's': /*print the score*/
  1355. X          sflag++;
  1356. X          break;
  1357. X      case '?': /*  print out command line arguments */
  1358. + #ifdef CHECKUSER
  1359. +         fprintf(stderr,"Command line format: %s [-Ghpls -d DIR -nNAT -u USER]\n",argv[0]);
  1360. +         fprintf(stderr,"\t-u USER  change nation username\n");
  1361. +         fprintf(stderr,"\t-l       list nation owners\n");
  1362. + #else
  1363. X          fprintf(stderr,"Command line format: %s [-Ghps -d DIR -nNAT]\n",argv[0]);
  1364. + #endif
  1365. X          fprintf(stderr,"\t-n NAT   play as nation NAT\n");
  1366. X          fprintf(stderr,"\t-d DIR   to use play different game\n");
  1367. X          fprintf(stderr,"\t-G       gaudily highlight nation in news\n");
  1368. ***************
  1369. *** 240,246 ****
  1370. X      *  executable is setuid.
  1371. X      */
  1372. X      if (getuid() != geteuid()) { /* we are running suid */
  1373. !         (void) umask(077);    /* nobody else can read files */
  1374. X          (void) setuid (geteuid ()) ;
  1375. X      }
  1376. X  
  1377. --- 269,275 ----
  1378. X      *  executable is setuid.
  1379. X      */
  1380. X      if (getuid() != geteuid()) { /* we are running suid */
  1381. !         (void) umask(MASK);    /* nobody else can read files */
  1382. X          (void) setuid (geteuid ()) ;
  1383. X      }
  1384. X  
  1385. ***************
  1386. *** 282,288 ****
  1387. X      }
  1388. X  #else
  1389. X      if(strcmp(name,"god")==0) strcpy(name,"unowned");
  1390. ! #endif OGOD
  1391. X      country=(-1);
  1392. X      for(i=0;i<NTOTAL;i++)
  1393. X      if(strcmp(name,ntn[i].name)==0) {
  1394. --- 311,335 ----
  1395. X      }
  1396. X  #else
  1397. X      if(strcmp(name,"god")==0) strcpy(name,"unowned");
  1398. ! #endif /* OGOD */
  1399. ! #ifdef CHECKUSER
  1400. !     if ((checkuser_mod) || (checkuser_list)) {
  1401. !         if ((owneruid == (getpwnam(LOGIN))->pw_uid) ||
  1402. !                 (owneruid == (getpwnam(ntn[0].leader))->pw_uid)) {
  1403. !             /* don't change - already set */    
  1404. !         }
  1405. !         else {
  1406. !             checkuser_mod = FALSE;
  1407. !             checkuser_list = FALSE;
  1408. !             fprintf (stderr, "Sorry -- only god may modify/list a nation's uid\n");
  1409. !                   exit(FAIL);
  1410. !         }
  1411. !     }
  1412. ! #else
  1413. !         fprintf (stderr,"CHECKUSER not on\n");
  1414. !         exit (FAIL);
  1415. ! #endif
  1416. X      country=(-1);
  1417. X      for(i=0;i<NTOTAL;i++)
  1418. X      if(strcmp(name,ntn[i].name)==0) {
  1419. ***************
  1420. *** 372,377 ****
  1421. --- 419,460 ----
  1422. X          exit(SUCCESS);
  1423. X      }
  1424. X  
  1425. + #ifdef CHECKUSER
  1426. +         /* New code by "spide" */
  1427. +     if (checkuser_mod)
  1428. +        {
  1429. +         fprintf (stderr, "Nation:  %s\n", curntn->name);
  1430. +                 fprintf (stderr, "   Current player = %s\n", 
  1431. +             getpwuid(curntn->uid)->pw_name);;
  1432. +         curntn->uid = checkuser_uid;
  1433. +                 fprintf (stderr, "   New player = %s\n", 
  1434. +             getpwuid(curntn->uid)->pw_name);
  1435. +         writedata();
  1436. +         exit (SUCCESS);
  1437. +        }
  1438. +     if (checkuser_list)
  1439. +        {
  1440. +               for (i=0; i < NTOTAL; i++) 
  1441. +             if (ntn[i].active != INACTIVE) 
  1442. +                 fprintf (stderr, "%3d %15s %d %-15s\n",
  1443. +                     i, ntn[i].name, 
  1444. +                     ntn[i].uid,
  1445. +                     getpwuid(ntn[i].uid)->pw_name);
  1446. +         exit (SUCCESS);
  1447. +        }
  1448. +         if ((curntn->uid != owneruid) &&
  1449. +         (owneruid != (getpwnam(LOGIN))->pw_uid) && 
  1450. +             (owneruid != (getpwnam(ntn[0].leader))->pw_uid) &&
  1451. +         (curntn->uid != (getpwnam(LOGIN))->pw_uid))
  1452. +            {
  1453. +               fprintf (stderr,"\nSorry -- you are not the owner of %s",curntn->name);
  1454. +           fprintf(stderr,"\nFor information on conquer please contact %s.",OWNER);
  1455. +               fprintf(stderr,"\nor send mail to %s", LOGIN);
  1456. +           fprintf(stderr,"\n");
  1457. +           exit(FAIL);
  1458. +            }
  1459. + #endif
  1460. X      initscr();        /* SET UP THE SCREEN */
  1461. X      /* check terminal size */
  1462. X      if (COLS<80 || LINES<24) {
  1463. ***************
  1464. *** 425,436 ****
  1465. X          execute(FALSE);
  1466. X  #ifdef TRADE
  1467. X          checktrade();
  1468. ! #endif TRADE
  1469. X          xcurs = curntn->capx;
  1470. X          ycurs = curntn->capy;
  1471. X      }
  1472. X      xoffset = 0;
  1473. X      yoffset = 0;
  1474. X      centermap();
  1475. X      updmove(curntn->race,country);
  1476. X  
  1477. --- 508,525 ----
  1478. X          execute(FALSE);
  1479. X  #ifdef TRADE
  1480. X          checktrade();
  1481. ! #endif /* TRADE */
  1482. X          xcurs = curntn->capx;
  1483. X          ycurs = curntn->capy;
  1484. X      }
  1485. X      xoffset = 0;
  1486. X      yoffset = 0;
  1487. + #ifdef USERLOG
  1488. +     userlog = fopen (".userlog", "a");
  1489. +         fprintf (userlog, "%3d %15s %30s %15s\n", 
  1490. +            TURN, getpwuid(owneruid)->pw_name, defaultdir, curntn->name);
  1491. +         fclose (userlog);
  1492. + #endif
  1493. X      centermap();
  1494. X      updmove(curntn->race,country);
  1495. X  
  1496. ***************
  1497. *** 462,468 ****
  1498. X      } else {
  1499. X          (void) strcpy(sysmail,getenv("MAIL"));
  1500. X      }
  1501. ! #endif SYSMAIL
  1502. X      mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY");
  1503. X      refresh();
  1504. X      getch();        /* get response from copyscreen */
  1505. --- 551,557 ----
  1506. X      } else {
  1507. X          (void) strcpy(sysmail,getenv("MAIL"));
  1508. X      }
  1509. ! #endif /* SYSMAIL */
  1510. X      mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY");
  1511. X      refresh();
  1512. X      getch();        /* get response from copyscreen */
  1513. ***************
  1514. *** 529,535 ****
  1515. X      if (conq_mail_status==NEW_MAIL) {
  1516. X          mvaddstr(LINES-3,COLS/2-6,"You have Conquer Mail");
  1517. X      }
  1518. ! #endif SYSMAIL
  1519. X  }
  1520. X  
  1521. X  /************************************************************************/
  1522. --- 618,624 ----
  1523. X      if (conq_mail_status==NEW_MAIL) {
  1524. X          mvaddstr(LINES-3,COLS/2-6,"You have Conquer Mail");
  1525. X      }
  1526. ! #endif /* SYSMAIL */
  1527. X  }
  1528. X  
  1529. X  /************************************************************************/
  1530. ***************
  1531. *** 765,771 ****
  1532. X          curntn->tgold -= MOVECOST;
  1533. X          redraw=FULL;
  1534. X          break;
  1535. ! #endif TRADE
  1536. X      case '9':
  1537. X      case 'u':    /*move north-east*/
  1538. X          pager=0;
  1539. --- 854,860 ----
  1540. X          curntn->tgold -= MOVECOST;
  1541. X          redraw=FULL;
  1542. X          break;
  1543. ! #endif /* TRADE */
  1544. X      case '9':
  1545. X      case 'u':    /*move north-east*/
  1546. X          pager=0;
  1547. ***************
  1548. *** 1247,1253 ****
  1549. X  
  1550. X      for(i=0;*(veg+i)!='0';i++)
  1551. X          if(sptr->vegetation==*(veg+i))
  1552. !         mvprintw(LINES-11,COLS-9,"%s",*(vegname+i));
  1553. X  
  1554. X      if(((i=tofood(sptr,country)) != 0)
  1555. X      &&((magic(sptr->owner,THE_VOID)!=TRUE)
  1556. --- 1336,1342 ----
  1557. X  
  1558. X      for(i=0;*(veg+i)!='0';i++)
  1559. X          if(sptr->vegetation==*(veg+i))
  1560. !         mvprintw(LINES-11,COLS-10,"%s",*(vegname+i));
  1561. X  
  1562. X      if(((i=tofood(sptr,country)) != 0)
  1563. X      &&((magic(sptr->owner,THE_VOID)!=TRUE)
  1564. ***************
  1565. *** 1259,1265 ****
  1566. X  #else
  1567. X          if(i<10)    mvprintw(LINES-11,COLS-2,"%d",i);
  1568. X          else        mvprintw(LINES-11,COLS-3,"%d",i);
  1569. ! #endif HPUX
  1570. X          standend();
  1571. X      }
  1572. X  
  1573. --- 1348,1354 ----
  1574. X  #else
  1575. X          if(i<10)    mvprintw(LINES-11,COLS-2,"%d",i);
  1576. X          else        mvprintw(LINES-11,COLS-3,"%d",i);
  1577. ! #endif /* HPUX */
  1578. X          standend();
  1579. X      }
  1580. X  
  1581. ***************
  1582. *** 1271,1277 ****
  1583. X  
  1584. X      for(i=0;(*(ele+i) != '0');i++)
  1585. X          if( sptr->altitude == *(ele+i) ){
  1586. !             mvprintw(LINES-10,COLS-9,"%s",*(elename+i));
  1587. X              break;
  1588. X          }
  1589. X      }
  1590. --- 1360,1366 ----
  1591. X  
  1592. X      for(i=0;(*(ele+i) != '0');i++)
  1593. X          if( sptr->altitude == *(ele+i) ){
  1594. !             mvprintw(LINES-10,COLS-10,"%s",*(elename+i));
  1595. X              break;
  1596. X          }
  1597. X      }
  1598. diff -cr ../oldconq4/makeworl.c ./makeworl.c
  1599. *** ../oldconq4/makeworl.c    Thu Jul  9 19:22:29 1992
  1600. --- ./makeworl.c    Thu Jul  9 18:19:15 1992
  1601. ***************
  1602. *** 141,147 ****
  1603. X      }
  1604. X  #else
  1605. X      (void) strcpy(ntn[0].leader,"god");
  1606. ! #endif REMAKE
  1607. X      while(TRUE) {
  1608. X          mvprintw(9,0,"What demi-god shall co-rule this world? [%s]: ",ntn[0].leader);
  1609. X          clrtoeol();
  1610. --- 141,147 ----
  1611. X      }
  1612. X  #else
  1613. X      (void) strcpy(ntn[0].leader,"god");
  1614. ! #endif /* REMAKE */
  1615. X      while(TRUE) {
  1616. X          mvprintw(9,0,"What demi-god shall co-rule this world? [%s]: ",ntn[0].leader);
  1617. X          clrtoeol();
  1618. ***************
  1619. *** 193,198 ****
  1620. --- 193,201 ----
  1621. X              newerror("That Name is Too long.");
  1622. X          }
  1623. X      }
  1624. + #ifdef CHECKUSER
  1625. +     ntn[0].uid = getuid();
  1626. + #endif
  1627. X      mvaddstr(8,0,"Please Enter the Size of the World.  [Divisible by 8 and > 23]");
  1628. X      clrtoeol();
  1629. X      while(TRUE) {
  1630. ***************
  1631. *** 1134,1146 ****
  1632. X  
  1633. X      newmsg("... All random population and monsters placed");
  1634. X      sleep(1);
  1635. ! #endif MONSTER
  1636. X  
  1637. X      for (i=0;i<MAXHELP;i++) {
  1638. X          sprintf(fname,"%s/%s%d",DEFAULTDIR,helpfile,i);
  1639. X          if ((fp=fopen(fname,"r"))==NULL) {
  1640. X              char tempc[BIGLTH];
  1641. !             sprintf(tempc,"cannot find helpfile <%s/%s>.",DEFAULTDIR,fname);
  1642. X              newerror(tempc);
  1643. X          }
  1644. X      }
  1645. --- 1137,1149 ----
  1646. X  
  1647. X      newmsg("... All random population and monsters placed");
  1648. X      sleep(1);
  1649. ! #endif /* MONSTER */
  1650. X  
  1651. X      for (i=0;i<MAXHELP;i++) {
  1652. X          sprintf(fname,"%s/%s%d",DEFAULTDIR,helpfile,i);
  1653. X          if ((fp=fopen(fname,"r"))==NULL) {
  1654. X              char tempc[BIGLTH];
  1655. !             sprintf(tempc,"cannot find helpfile <%s>.",fname);
  1656. X              newerror(tempc);
  1657. X          }
  1658. X      }
  1659. ***************
  1660. *** 1271,1275 ****
  1661. X      att_base();    /* get nation attributes */
  1662. X      newmsg("All NPC nations placed");
  1663. X      sleep(1);
  1664. ! #endif NPC
  1665. X  }
  1666. --- 1274,1278 ----
  1667. X      att_base();    /* get nation attributes */
  1668. X      newmsg("All NPC nations placed");
  1669. X      sleep(1);
  1670. ! #endif /* NPC */
  1671. X  }
  1672. diff -cr ../oldconq4/misc.c ./misc.c
  1673. *** ../oldconq4/misc.c    Thu Jul  9 19:26:26 1992
  1674. --- ./misc.c    Thu Jul  9 18:20:48 1992
  1675. ***************
  1676. *** 44,50 ****
  1677. X  
  1678. X      return( 0 );
  1679. X  } /* move_file() */
  1680. ! #endif CONQUER
  1681. X  
  1682. X  /* returns integer input greater than zero or */
  1683. X  /* -1 for no input.                           */
  1684. --- 44,50 ----
  1685. X  
  1686. X      return( 0 );
  1687. X  } /* move_file() */
  1688. ! #endif /* CONQUER */
  1689. X  
  1690. X  /* returns integer input greater than zero or */
  1691. X  /* -1 for no input.                           */
  1692. ***************
  1693. *** 285,291 ****
  1694. X      free(history_reachp);
  1695. X      return( result );
  1696. X  } /* land_reachp() */
  1697. ! #endif ADMIN
  1698. X  #ifdef ADMIN
  1699. X  /*
  1700. X   *    water_2reachp()
  1701. --- 285,291 ----
  1702. X      free(history_reachp);
  1703. X      return( result );
  1704. X  } /* land_reachp() */
  1705. ! #endif /* ADMIN */
  1706. X  #ifdef ADMIN
  1707. X  /*
  1708. X   *    water_2reachp()
  1709. ***************
  1710. *** 388,394 ****
  1711. X  
  1712. X      return( 0 );
  1713. X  } /* water_2reachp() */
  1714. ! #endif ADMIN
  1715. X  #ifdef XYZ    /* XYZ never is defined */
  1716. X  /*
  1717. X   *    water_reachp()
  1718. --- 388,394 ----
  1719. X  
  1720. X      return( 0 );
  1721. X  } /* water_2reachp() */
  1722. ! #endif /* ADMIN */
  1723. X  #ifdef XYZ    /* XYZ never is defined */
  1724. X  /*
  1725. X   *    water_reachp()
  1726. ***************
  1727. *** 428,434 ****
  1728. X  
  1729. X      return( water_2reachp( ax, ay, move_points ) );
  1730. X  } /* water_reachp() */
  1731. ! #endif 0
  1732. X  
  1733. X  /*
  1734. X   *    solds_in_sector()
  1735. --- 428,434 ----
  1736. X  
  1737. X      return( water_2reachp( ax, ay, move_points ) );
  1738. X  } /* water_reachp() */
  1739. ! #endif /* 0 */
  1740. X  
  1741. X  /*
  1742. X   *    solds_in_sector()
  1743. ***************
  1744. *** 538,544 ****
  1745. X      total += bonus/10;
  1746. X      return( total );
  1747. X  } /* score_one() */
  1748. ! #endif ADMIN
  1749. X  /*
  1750. X   *    print_accum()
  1751. X   */
  1752. --- 538,544 ----
  1753. X      total += bonus/10;
  1754. X      return( total );
  1755. X  } /* score_one() */
  1756. ! #endif /* ADMIN */
  1757. X  /*
  1758. X   *    print_accum()
  1759. X   */
  1760. ***************
  1761. *** 585,591 ****
  1762. X      curntn = nptr;
  1763. X      return(count);
  1764. X  }
  1765. ! #endif CONQUER
  1766. X  
  1767. X  int
  1768. X  num_powers(nation,type)
  1769. --- 585,591 ----
  1770. X      curntn = nptr;
  1771. X      return(count);
  1772. X  }
  1773. ! #endif /* CONQUER */
  1774. X  
  1775. X  int
  1776. X  num_powers(nation,type)
  1777. ***************
  1778. *** 637,643 ****
  1779. X              if ((magic(cntry,DERVISH)||magic(cntry,DESTROYER))
  1780. X              &&(sptr->vegetation==DESERT || sptr->vegetation==ICE))
  1781. X                  return(6);
  1782. ! #endif DERVDESG
  1783. X              return( 0 );
  1784. X          }
  1785. X          if(ntn[cntry].race == ELF){
  1786. --- 637,643 ----
  1787. X              if ((magic(cntry,DERVISH)||magic(cntry,DESTROYER))
  1788. X              &&(sptr->vegetation==DESERT || sptr->vegetation==ICE))
  1789. X                  return(6);
  1790. ! #endif /* DERVDESG */
  1791. X              return( 0 );
  1792. X          }
  1793. X          if(ntn[cntry].race == ELF){
  1794. ***************
  1795. *** 849,855 ****
  1796. X                  if(ispc(curntn->active)) {
  1797. X                      fprintf(fm,"\tsector %d, %d joins nation %s\n",ntn[nation].name);
  1798. X                  }
  1799. ! #endif NOTDONE
  1800. X              }
  1801. X          }
  1802. X      }
  1803. --- 849,855 ----
  1804. X                  if(ispc(curntn->active)) {
  1805. X                      fprintf(fm,"\tsector %d, %d joins nation %s\n",ntn[nation].name);
  1806. X                  }
  1807. ! #endif /* NOTDONE */
  1808. X              }
  1809. X          }
  1810. X      }
  1811. ***************
  1812. *** 958,964 ****
  1813. X      /* restore */
  1814. X      curntn = saventn;
  1815. X  }
  1816. ! #endif ADMIN
  1817. X  
  1818. X  /*destroy nation--special case if capitol not owned by other nation*/
  1819. X  void
  1820. --- 958,964 ----
  1821. X      /* restore */
  1822. X      curntn = saventn;
  1823. X  }
  1824. ! #endif /* ADMIN */
  1825. X  
  1826. X  /*destroy nation--special case if capitol not owned by other nation*/
  1827. X  void
  1828. ***************
  1829. *** 1161,1167 ****
  1830. X  
  1831. X      return(hold);
  1832. X  }
  1833. ! #endif CONQUER
  1834. X  #ifdef ADMIN
  1835. X  /* determines whether or not a unit has the ability to fly */
  1836. X  int
  1837. --- 1161,1167 ----
  1838. X  
  1839. X      return(hold);
  1840. X  }
  1841. ! #endif /* CONQUER */
  1842. X  #ifdef ADMIN
  1843. X  /* determines whether or not a unit has the ability to fly */
  1844. X  int
  1845. ***************
  1846. *** 1180,1186 ****
  1847. X          return(FALSE);
  1848. X      }
  1849. X  }
  1850. ! #endif ADMIN
  1851. X  
  1852. X  void
  1853. X  spreadsheet(nation)
  1854. --- 1180,1186 ----
  1855. X          return(FALSE);
  1856. X      }
  1857. X  }
  1858. ! #endif /* ADMIN */
  1859. X  
  1860. X  void
  1861. X  spreadsheet(nation)
  1862. ***************
  1863. *** 1326,1332 ****
  1864. X              }
  1865. X              spread.revfood += product*TAXFOOD*nptr->tax_rate/100L;
  1866. X          }
  1867. ! #endif DERVDESG
  1868. X          else {    /* other sectors */
  1869. X              spread.inothr += sptr->people;
  1870. X              if(sptr->people>TOMANYPEOPLE) {
  1871. --- 1326,1332 ----
  1872. X              }
  1873. X              spread.revfood += product*TAXFOOD*nptr->tax_rate/100L;
  1874. X          }
  1875. ! #endif /* DERVDESG */
  1876. X          else {    /* other sectors */
  1877. X              spread.inothr += sptr->people;
  1878. X              if(sptr->people>TOMANYPEOPLE) {
  1879. ***************
  1880. *** 1446,1452 ****
  1881. X      country=0;
  1882. X      curntn= &ntn[country];
  1883. X  }
  1884. ! #endif CONQUER
  1885. X  
  1886. X  #ifdef ADMIN
  1887. X  int
  1888. --- 1446,1452 ----
  1889. X      country=0;
  1890. X      curntn= &ntn[country];
  1891. X  }
  1892. ! #endif /* CONQUER */
  1893. X  
  1894. X  #ifdef ADMIN
  1895. X  int
  1896. ***************
  1897. *** 1471,1477 ****
  1898. X      }
  1899. X      return(-1);    /* shut lint up */
  1900. X  }
  1901. ! #endif ADMIN
  1902. X  
  1903. X  /* name of the currently open mail file */
  1904. X  char tmp_mail_name[LINELTH];
  1905. --- 1471,1477 ----
  1906. X      }
  1907. X      return(-1);    /* shut lint up */
  1908. X  }
  1909. ! #endif /* ADMIN */
  1910. X  
  1911. X  /* name of the currently open mail file */
  1912. X  char tmp_mail_name[LINELTH];
  1913. ***************
  1914. *** 1625,1631 ****
  1915. X      }
  1916. X      return(TRUE);
  1917. X  }
  1918. ! #endif ADMIN
  1919. X  
  1920. X  /*******************************************************************/
  1921. X  /* DEFAULTUNIT() returns the default army type for a given country */
  1922. --- 1625,1631 ----
  1923. X      }
  1924. X      return(TRUE);
  1925. X  }
  1926. ! #endif /* ADMIN */
  1927. X  
  1928. X  /*******************************************************************/
  1929. X  /* DEFAULTUNIT() returns the default army type for a given country */
  1930. ***************
  1931. *** 1721,1727 ****
  1932. X          sptr->jewels = rand()%17 + 4;
  1933. X      }
  1934. X  }
  1935. ! #endif ADMIN
  1936. X  
  1937. X  /* tg_ok returns true if a trade good can be seen by the owner of sector */
  1938. X  int
  1939. --- 1721,1727 ----
  1940. X          sptr->jewels = rand()%17 + 4;
  1941. X      }
  1942. X  }
  1943. ! #endif /* ADMIN */
  1944. X  
  1945. X  /* tg_ok returns true if a trade good can be seen by the owner of sector */
  1946. X  int
  1947. ***************
  1948. *** 1823,1829 ****
  1949. X  off_t conq_mail_size=0;
  1950. X  #ifdef SYSMAIL
  1951. X  static off_t sys_mail_size=0;
  1952. ! #endif SYSMAIL
  1953. X  void
  1954. X  check_mail()
  1955. X  {
  1956. --- 1823,1829 ----
  1957. X  off_t conq_mail_size=0;
  1958. X  #ifdef SYSMAIL
  1959. X  static off_t sys_mail_size=0;
  1960. ! #endif /* SYSMAIL */
  1961. X  void
  1962. X  check_mail()
  1963. X  {
  1964. ***************
  1965. *** 1895,1900 ****
  1966. X          move(ycurs,2*xcurs);
  1967. X          refresh();
  1968. X      }
  1969. ! #endif SYSMAIL
  1970. X  }
  1971. ! #endif CONQUER
  1972. --- 1895,1900 ----
  1973. X          move(ycurs,2*xcurs);
  1974. X          refresh();
  1975. X      }
  1976. ! #endif /* SYSMAIL */
  1977. X  }
  1978. ! #endif /* CONQUER */
  1979. diff -cr ../oldconq4/navy.c ./navy.c
  1980. *** ../oldconq4/navy.c    Thu Jul  9 19:26:30 1992
  1981. --- ./navy.c    Thu Jul  9 18:19:46 1992
  1982. ***************
  1983. *** 234,240 ****
  1984. X      if (hold==99) hold=N_NOSPD;
  1985. X      return(hold);
  1986. X  }
  1987. ! #endif ADMIN
  1988. X  
  1989. X  /* this function returns the amount of storage space in a */
  1990. X  /*   given fleet.  heavy+=3  medium+=2  light+=1.         */
  1991. --- 234,240 ----
  1992. X      if (hold==99) hold=N_NOSPD;
  1993. X      return(hold);
  1994. X  }
  1995. ! #endif /* ADMIN */
  1996. X  
  1997. X  /* this function returns the amount of storage space in a */
  1998. X  /*   given fleet.  heavy+=3  medium+=2  light+=1.         */
  1999. ***************
  2000. *** 268,274 ****
  2001. X      }
  2002. X      return(hold);
  2003. X  }
  2004. ! #endif ADMIN
  2005. X  
  2006. X  /* this function returns the amount of storage space in galleys */
  2007. X  int
  2008. --- 268,274 ----
  2009. X      }
  2010. X      return(hold);
  2011. X  }
  2012. ! #endif /* ADMIN */
  2013. X  
  2014. X  /* this function returns the amount of storage space in galleys */
  2015. X  int
  2016. ***************
  2017. *** 542,545 ****
  2018. X          }
  2019. X      }
  2020. X  }
  2021. ! #endif CONQUER
  2022. --- 542,545 ----
  2023. X          }
  2024. X      }
  2025. X  }
  2026. ! #endif /* CONQUER */
  2027. diff -cr ../oldconq4/newhelp.c ./newhelp.c
  2028. *** ../oldconq4/newhelp.c    Thu Jul  9 19:17:27 1992
  2029. --- ./newhelp.c    Thu Jul  9 18:20:01 1992
  2030. ***************
  2031. *** 21,32 ****
  2032. X  {
  2033. X      FILE *fp, *fp2, *fopen();
  2034. X      if((fp=fopen("sed.1","w"))==NULL) {
  2035. !         printf("cant open sed.1 file\n");
  2036. X          exit(FAIL);
  2037. X      }
  2038. X      /* needed as sed was reaching its limit on number of commands */
  2039. X      if((fp2=fopen("sed.2","w"))==NULL) {    
  2040. !         printf("cant open sed.2 file\n");
  2041. X          exit(FAIL);
  2042. X      }
  2043. X  
  2044. --- 21,32 ----
  2045. X  {
  2046. X      FILE *fp, *fp2, *fopen();
  2047. X      if((fp=fopen("sed.1","w"))==NULL) {
  2048. !         printf("cannot open sed.1 file\n");
  2049. X          exit(FAIL);
  2050. X      }
  2051. X      /* needed as sed was reaching its limit on number of commands */
  2052. X      if((fp2=fopen("sed.2","w"))==NULL) {    
  2053. !         printf("cannot open sed.2 file\n");
  2054. X          exit(FAIL);
  2055. X      }
  2056. X  
  2057. ***************
  2058. *** 202,208 ****
  2059. X      fprintf(fp,"s/XFINDPERCENT/%d/g\n",FINDPERCENT);
  2060. X  #ifdef ORCTAKE
  2061. X      fprintf(fp,"s/XTAKEPRICE/%d/g\n",ORCTAKE);
  2062. ! #endif ORCTAKE
  2063. X  
  2064. X      fprintf(fp,"s/XTGATTR/%d/g\n",TGATTR);
  2065. X      fprintf(fp,"s/XOTHRATTR/%d/g\n",OTHRATTR);
  2066. --- 202,208 ----
  2067. X      fprintf(fp,"s/XFINDPERCENT/%d/g\n",FINDPERCENT);
  2068. X  #ifdef ORCTAKE
  2069. X      fprintf(fp,"s/XTAKEPRICE/%d/g\n",ORCTAKE);
  2070. ! #endif /* ORCTAKE */
  2071. X  
  2072. X      fprintf(fp,"s/XTGATTR/%d/g\n",TGATTR);
  2073. X      fprintf(fp,"s/XOTHRATTR/%d/g\n",OTHRATTR);
  2074. diff -cr ../oldconq4/newlogin.c ./newlogin.c
  2075. *** ../oldconq4/newlogin.c    Thu Jul  9 19:29:35 1992
  2076. --- ./newlogin.c    Thu Jul  9 18:06:32 1992
  2077. ***************
  2078. *** 12,17 ****
  2079. --- 12,18 ----
  2080. X  
  2081. X  /*create a new login for a new player*/
  2082. X  #include <ctype.h>
  2083. + #include <pwd.h>
  2084. X  #include "patchlevel.h"
  2085. X  #include "header.h"
  2086. X  #include "data.h"
  2087. ***************
  2088. *** 342,351 ****
  2089. X  }
  2090. X  
  2091. X  void
  2092. ! newlogin()
  2093. X  {
  2094. X      /* use points to create empire, add if late starter*/
  2095. X      int points, clr;
  2096. SHAR_EOF
  2097. true || echo 'restore of patches11 failed'
  2098. fi
  2099. echo 'End of part 1, continue with part 2'
  2100. echo 2 > _shar_seq_.tmp
  2101. exit 0
  2102.